package classdemo;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.Date;

/**
 * @DESCRIPATION
 * @AUTHOR 戴超
 * @DATE 2018/6/19
 **/
public class URLTest3 {
    public static void main(String[] args) throws IOException {
        URL url = new URL("http://www.baidu.com"); //  指定操作的URL
        URLConnection urlCon = url.openConnection(); //  建立连接
        System.out.println(" 内容大小：" + urlCon.getContentLength());
        System.out.println(" 内容类型：" + urlCon.getContentType());
        System.out.println("Date: " + new Date(urlCon.getDate()));
        System.out.println("Last-Modified: " + new
                Date(urlCon.getLastModified()));
    }
}
